﻿using System;
using System.Data;
using System.Collections.Generic;
using EnterpriseFund.Model;
namespace EnterpriseFund.BLL
{
    /// <summary>
    /// GS_SB_ZSXX
    /// </summary>
    public partial class GS_SB_ZSXX
    {
        private readonly EnterpriseFund.DAL.GS_SB_ZSXX dal = new EnterpriseFund.DAL.GS_SB_ZSXX();
        public GS_SB_ZSXX()
        { }
        #region  BasicMethod
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public decimal Add(EnterpriseFund.Model.GS_SB_ZSXX model)
        {
            return dal.Add(model);
        }

                /// <summary>
        /// 比较国税导入数据是否有误
        /// </summary>
        /// <param name="dt"></param>
        /// <param name="outTimes"></param>
        /// <returns></returns>
        public Model.GSGompareDate GompareImportDate(DataTable dt, int outTimes = 60*60)
        {
            return dal.GompareImportDate(dt, outTimes);
        }
        public string ImportDate(DataTable dt, int outTimes = 60*60)
        {
           return dal.ImportDate(dt, outTimes);
        }

        public bool ExistsTaxAuditDate(decimal FYear, int FPeriod)
        {
            return dal.ExistsTaxAuditDate(FYear, FPeriod);
        }
                /// <summary>
        /// 是否存在该记录
        /// </summary>
        public bool Exists(decimal FYear, int FPeriod)
        {
            return dal.Exists(FYear, FPeriod);
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List<Model.GS_SB_ZSXX> DataTableToList(DataTable dt)
        {
            List<Model.GS_SB_ZSXX> modelList = new List<Model.GS_SB_ZSXX>();
            int rowsCount = dt.Rows.Count;
            if (rowsCount > 0)
            {
                Model.GS_SB_ZSXX model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = dal.DataRowToModel(dt.Rows[n]);
                    if (model != null)
                    {
                        modelList.Add(model);
                    }
                }
            }
            return modelList;
        }
        /// <summary>
        /// 分页获取数据列表
        /// </summary>
        public int GetRecordCount(string strWhere)
        {
            return dal.GetRecordCount(strWhere);
        }

        /// <summary>
        /// 删除该年度下该期数据
        /// </summary>
        public bool Delete(decimal FYear, int FPeriod)
        {
            return dal.Delete(FYear, FPeriod);
        }

                /// <summary>
        /// 获取当前最大批次
        /// </summary>
        public string GetFPeriod()
        {
            return dal.GetFPeriod();
        }

               /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetList(string strWhere)
        {
            return dal.GetList(strWhere);
        }

        #endregion  BasicMethod
        #region  ExtensionMethod

        #endregion  ExtensionMethod
    }
}

